---@type MappingsTable
local M = {}
local default_ops = {
  nowait = true,
  noremap = true,
}

M.general = {
  n = {
    ["D"] = { "", "disable D map", opts = { noremap = true } },
    [";"] = { ":", "enter command mode", opts = { nowait = true } },
    ["<leader>gg"] = {
      function()
        _toggle_lazygit()
      end,
      "Toggle lazygit",
      ops = { nowait = true },
    },
    ["<C-\\>"] = { "<cmd> ToggleTerm <CR>", "toggle vertical term", opts = { nowait = true } },
    -- move line
    ["<A-Down>"] = { "<cmd> m .+1 <CR>", "move line down", opts = { nowait = true, noremap = true } },
    ["<A-Up>"] = { "<cmd> m .-2 <CR>", "move line up", opts = { nowait = true, noremap = true } },
    ["<leader>nf"] = {
      "<cmd> lua require('neogen').generate({type = 'func'})<CR>",
      "generate funtion anno",
      opts = default_ops,
    },
    ["<leader>nc"] = {
      "<cmd> lua require('neogen').generate({type = 'class'})",
      "generate class anno",
      opts = default_ops,
    },
    ["<leader>nd"] = { "<cmd> lua require('neogen').generate() <CR>", "generate anno", opts = default_ops },
    ["<C-w>v"] = { "<cmd> :vsplit <CR>", "split window vertical", opts = default_ops },
    ["<C-Left>"] = { "<cmd> :vertical resize -1 <CR>", "move buffer border left", opts = default_ops },
    ["<C-Right>"] = { "<cmd> :vertical resize +1 <CR>", "move buffer border right", opts = default_ops },
  },
  i = {
    ["<A-Down>"] = { "<Esc>:m .+1<CR>==gi", "move line down", opts = default_ops },
    ["<A-Up>"] = { "<Esc>:m .-2<CR>==gi", "move line up", opts = default_ops },
  },
  v = {
    [">"] = { ">gv", "indent" },
    ["<A-Up>"] = { ":m '<-2<CR>gv=gv", "move line up", opts = default_ops },
    ["<A-Down>"] = { ":m '>+1<CR>gv=gi", "move line down", opts = default_ops },
  },
  t = {
    ["<C-\\>"] = { "<cmd> ToggleTerm <CR>", "ToggleTerm", opts = { nowait = true } },
  },
}

-- more keybinds!

return M
